package com.dy.dynotinstalled.room;

import android.content.Context;


import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;




/**
 * @author Li Xuyang
 * @date : 2019/9/26 19:12
 */
@Database(entities = {NotDoorInformation.class}, version = 1, exportSchema = false)
public abstract class InformationDatabase extends RoomDatabase {
    private static InformationDatabase INSTANCE;

    public static synchronized InformationDatabase getDatabase(Context context) {
        if (INSTANCE == null) {
            INSTANCE = Room.databaseBuilder(context.getApplicationContext(), InformationDatabase.class, "doorInformationDatabase_database")
                    //破环式的
                     .fallbackToDestructiveMigration()

                    .build();
        }
        return INSTANCE;
    }

    public abstract NotDoorInformationDao doorInformationDao();


}
